<template>
  <section>
    <base-card>
      <h2>Rigister  as  a coach now!</h2>
      <coach-form @save-data="saveData"></coach-form>
    </base-card>
  </section>

</template>
<script>
import CoachForm from '../../components/coaches/CoachForm.vue';

export default{
    components:
    {
      CoachForm,
    },
   
    methods:{
      saveData(data)
      {
         // 提交教练数据到 Vuex store
        this.$store.dispatch('coaches/registerCoach',data);
        this.$router.replace('/coaches');// 导航到 '/coaches' 路由
      }
    }
}
</script>

